require(["coAjax", "jQuery", "browser", "href"], function(coAjax, $, browser, href) {

    //获取指定页的商品
    coAjax.get(appConfig.goods.list, {
        bus_id: appConfig.bus_id,
        num: 15,
        page: 0
    }, function(result) {
        console.log("goods:", result.result);
        jSouper.ready(function() {
            App.set("goods_list", result.result);
        });
    }, function() {
        console.log(arguments);
    });
    var _search_ti;
    App.set("$Event.goods.search", function() {
        clearTimeout(_search_ti);
        _search_ti = setTimeout(function() {
            coAjax.get(appConfig.goods.search, {
                bus_id: appConfig.bus_id,
                q: App.get("$Cache.search_value")
            }, function(result) {
                App.set("$Cache.search_result", result.result);
            });
        }, 120);
    });
    var _unsearch_ti;
    App.set("$Event.goods.un_search", function() {
        clearTimeout(_unsearch_ti);
        _unsearch_ti = setTimeout(function() {
            App.set("$Cache.search_result", []);
        }, 200)
    });
});
